package com.test.controller;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import com.test.handler.ConsumerBlockHandler;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SentinelController {
    @GetMapping("/test22")
    @SentinelResource(value = "test22",
            blockHandlerClass = ConsumerBlockHandler.class,
            blockHandler = "handlerException1",
            fallbackClass = ConsumerBlockHandler.class,
            fallback = "handlerException2") //1限流   2报错
    public String test() {
        return "sentinel";
    }
    public String test2() {
        return "sentinel2------------------";
    }
}
